package com.baidu.file;

import java.io.File;
import java.text.SimpleDateFormat;

public class D02_FileJudge {
    public static void main(String[] args) {
        File file = new File("src/002.dat");
        //1.绝对路径
        String absolutePath = file.getAbsolutePath();
        //2.输入路径
        String path = file.getPath();
        //3.文件名称
        String name = file.getName();
        //4.最后修改时间
        long updateTime = file.lastModified();
        String formatTIme = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(updateTime);


        System.out.println(absolutePath);
        System.out.println(path);
        System.out.println(name);
        System.out.println(formatTIme);
    }
}
